from courses.models import Role

def required_role(role):
    def decorator(func):
        func.required_role = Role(role)
        #the actual redirecting is done in courses.middleware.CourseAuthMiddleware
        return func
    return decorator
